This invention relates to a personal computer built-in numerical control system and in particular to breakage of an external storage unit and data destruction prevention when power is turned off.
With a personal computer built-in numerical control system, a work program is edited, etc., in a man-machine interface processing section (which will be hereinafter referred to as the MMI processing section) of a personal computer section (which will be hereinafter referred to as the PC section) and the work program registered in memory of a numerical control system section (which will be hereinafter referred to as the NC section) is analyzed and interpolated in the NC section, then a command is output to a servo system of a machine tool in response to the processing result.
FIG. 11 shows an outline of a personal computer built-in numerical control system (which will be hereinafter referred to as the PC built-in numerical control system). The PC built-in numerical control system has an NC section 100 for executing a work program and a PC section 200 for mainly performing screen display processing and setting processing of data, etc., and power is supplied from a power unit 5. The power unit 5 converts AC power supply 200 VAC into DC and supplies 24 VDC to the numerical control system.
The NC section 100 has a work program analysis processing section 10, memory 11, an interpolation processing section 12, axis control sections 13, a machine control signal processing section 30, a ladder circuit section 14, a digital signal input circuit (which will be hereinafter referred to as the DS input circuit) 15, a digital signal output circuit (which will be hereinafter referred to as the DS output circuit) 16, a PC interface section 17, dual port RAM 18, flash memory 19, and backup data write means 20.
Although only one axis control section 13 is shown in FIG. 11, it is provided for each axis and a servo amplifier 310 of a servo motor 300 of each axis is connected to each axis control section 13.
Although not shown in FIG. 11, the servo motor 300 is provided with a pulse generator for position detection and the servo amplifier 310 has a position loop based on a position feedback signal from the pulse generator.
The PC section 200 has a BIOS (Basic I/O System) section 201, an operating system section (which will be hereinafter referred to as the OS section) 202, an MMI processing section 210, and an NC interface section 203. A hard disk storage unit (which will be hereinafter referred to as the external storage unit) 250 and an operation panel 260 with a display are connected each through an interface (not shown).
The MMI processing section 210 has image display processing means 211 and data setting means 212.
The operation panel 260 has a display 261 made of a CRT, an LCD, etc., a data input section 262 as a keyboard, a power on switch 263, and a power off switch 264.
The PC built-in numerical control system in the related art is thus configured. Next, the operation of the PC built-in numerical control system will be discussed.
With the PC built-in numerical control system, the operator enters a work program by operating the operation panel 260 through the keyboard.
The keyed work program is input through the OS section 202 to the MMI processing section 210. The work program input to the MMI processing section 210 is converted by the data setting means 212 into data code that can be recognized by a personal computer and the data code is written onto the hard disk storage unit 250 through the OS section 202 and is transferred to the NC interface section 203 at the same time.
The NC interface section 203 writes the work program transferred from the data setting means 212 into a determined address of the dual port RAM 18 in the NC section 100 and turns on a data write completion flag.
The PC interface section 17 in the NC section 100 monitors the data write completion flag on the dual port RAM 18. Upon detection of the data write completion flag, the PC interface section 17 reads the work program written into the dual port RAM 18 and writes the work program into a file system constructed in the memory 11.
At this time, the PC interface section 20 checks whether or not code not handled in the numerical control system, for example, code of a lowercase alphabetical character, etc., exists.
The work program written into the hard disk storage unit 250 provides backup data if the work program registered in the memory 11 in the NC section 100 is destroyed.
The input work program is displayed on the display 261 as follows:
First, the PC interface section 17 reads the work program registered in the memory 11, writes the work program into a determined address of the dual port RAM 18, and turns on the data write completion flag.
The NC interface section 203 monitors the data write completion flag on the dual port RAM 18. Upon detection of the data write completion flag, the NC interface section 203 reads the work program written into the dual port RAM 18 and transfers the work program to the image display processing means 211.
The image display processing means 211 adds fixed display data of a screen title, etc., and the like to the received work program and outputs the resultant work program through the OS section 202 to the display 261, which then displays the data of the work program, etc.
Next, an execution procedure of the work program will be discussed. The workprogram analysis processing section 10 reads the work program one block at a time from the memory 11, processes the read work program, and calculates the end point position of each block. The interpolation processing section 12 interpolates the end point position and distributes to the end point position to a move command per unit time of each moving axis.
The move command output by the interpolation processing section 12 is converted into a move command per unit time considering acceleration and deceleration according to an acceleration and deceleration pattern previously specified by the axis control section 13, and the move command is output to the servo amplifier 310 as a servo move command.
Based on the servo move command, the servo amplifier 310 controls drive of the servo motor 300 attached to a machine tool (not shown).
A machine output signal of cutting oil on/off, etc., is sent from the machine control signal processing section 30 via the DS output circuit 16 to a relay circuit of a machine control panel (not shown), operating a cutting oil on/off switch, etc. A signal input from the machine side of a dog switch, etc., is input through the DS input circuit 15 to the machine control signal processing section 30. The signals input to the DS input circuit 15 and output from the DS output circuit 16 are processed by the machine control signal processing section 30 through the ladder circuit section 14 describing machine control, and the processing result, etc., is sent to the interpolation processing section 12.
To turn off the power of the PC built-in numerical control system in the related art as described above, the power off switch is pressed for shutting down the input power supply of 200 VAC of the power unit 5.
When the power is turned off, the backup data write means 20 reads parameters, etc., used for controlling the servo motors, etc., from the memory 11 and writes the parameters, etc., into the flash memory 19.
The PC built-in numerical control system in the related art is thus configured. Thus, when the PC built-in numerical control system is powered off unconditionally by pressing the power off switch 264, if an application program in the PC section 200 is accessing the hard disk storage unit 250, particularly if data is being written onto the hard disk storage unit 250, there is a possibility that the head may come in contact with the disk of the hard disk storage unit 250, causing damage to the disk or that a file registered on the hard disk storage unit 250 may be destroyed.
Although it is considered that the operator is made to surely terminate the application program and the OS in the PC section 200 and turn off the power, the power off operation becomes intricate and in addition, there is also a possibility that the operator may forget to terminate the application program and the OS in the PC section 200.
When the power is abruptly turned off because of a power outage, etc., if an application program in the PC section 200 is accessing the hard disk storage unit 250, particularly if data is being written onto the hard disk storage unit 250, there is a possibility that the hard disk storage unit 250 itself may be destroyed. If the application program in the PC section 200 does not normally terminate by power off handling, the power cannot be turned off.
Normally, the application program in the PC section 200 frequently accesses the hard disk storage unit 250 (reads or writes) during starting (during initialization), thus if the power is turned off at this time, there is a possibility that the hard disk storage unit 250 may be destroyed.
While the application program in the PC section 200 is accessing the hard disk storage unit 250, particularly while data is being written onto the hard disk storage unit 250, if the power of the numerical control system is turned off, there is a possibility that the hard disk storage unit 250 may be destroyed.
Thus, the main circuit breaker, etc., of the machine tool cannot be turned off arbitrarily in the ladder circuit section 14.
In the PC built-in numerical control system in the related art, when the power is turned off, parameters, etc., for controlling the servo motors, etc., are written into the flash memory 19, etc., in the NC section 100 for data backup. However, the flash memory 19 has a limited capacity and data, such as tool offset data used by the user, is not backed up.
It is therefore an object of the invention to provide a personal computer built-in numerical control system improved so as to turn off power soundly without destroying an external storage unit such as a hard disk storage unit and prevent the external storage unit from being destroyed if the power is abruptly shut down because of a power outage, etc.
To the end, according to the invention, there is provided a personal computer built-in numerical control system, wherein a personal computer is built, having a numerical control system section and a personal computer section, the personal computer built-in numerical control system comprising an interrupt generation circuit being placed in the numerical control system section for generating an interrupt in the numerical control system section when a power off switch is pressed, PC termination acknowledgement means being placed in the numerical control system section for sending a termination request to the personal computer section when the interrupt is generated by the interrupt generation circuit, acknowledging a PC termination notification from the personal computer section, and requesting a signal output circuit to turn on a signal assigned to power off of a power unit, a PC power down handling section being placed in the personal computer section for forcibly terminating an application program and an operating system in the personal computer section after sensing the termination request sent from the PC termination acknowledgement means in the NC section, PC power down handling start wait means being placed in the personal computer section for waiting for the power supply voltage holding time or longer still after the power of the power unit is turned off at the beginning of PC power down handling for preventing the system from advancing to the next process, and a BIOS section being placed in the personal computer section for checking that the operating system is terminated and sending a PC termination notification to the numerical control system section, wherein the power unit turns off power as the signal assigned to power off is turned on by the signal output circuit.
Thus, in the personal computer built-in numerical control system according to the invention, when the power off switch is pressed, the interrupt generation circuit generates an interrupt in the numerical control system section, whereby the PC termination acknowledgement means sends a PC termination request to the personal computer section and checks a PC termination notification from the personal computer section. If a PC termination notification comes, the PC termination acknowledgement means makes a request for turning on a signal assigned to power off of the power unit. When the PC power down handling section in the personal computer section receives the PC termination request sent from the PC termination acknowledgement means in the numerical control system section, it issues a request for forcibly terminating the application program and the operating system in the personal computer section. The BIOS section in the personal computer section detects the operating system being terminated in the personal computer section and sends a PC termination notification to the PC termination acknowledgement means in the numerical control system section. The power unit turns off the power as the signal assigned to power off is turned on. The PC power down handling start wait means in the personal computer section waits for the power supply voltage holding time or longer still after the power of the power unit is turned off at the beginning of PC power down handling for preventing the system from advancing to the next process.
The personal computer built-in numerical control system according to the invention described above further includes digital signal output selection means in the numerical control system section being placed in the personal computer section for setting the state of a digital output signal output by a machine control signal processing section in the numerical control system section to a specified state when power off handling is started.
Thus, in the personal computer built-in numerical control system according to the invention, when power off handling is started, the state of a digital output signal output by the machine control signal processing section is set to the specified state by the digital signal output selection means and the machine state when the power is turned off can be set to a predetermined state.
According to the invention, there is provided a personal computer built-in numerical control system, wherein a personal computer is built, having a numerical control system section and a personal computer section, the personal computer built-in numerical control system comprising power off request signal detection means being placed in the numerical control system section for detecting a power off request signal from a ladder circuit section, ladder circuit correspondence PC termination acknowledgement means being placed in the numerical control system section for sending a termination request to the personal computer section when the power off request signal is detected by the power off request signal detection means and acknowledging a termination notification from the personal computer section, power off enable signal output means being placed in the numerical control system section for turning on a power off enable signal for the ladder circuit section when the ladder circuit correspondence PC termination acknowledgement means acknowledges the PC termination notification from the personal computer section, a PC power down handling section being placed in the personal computer section for forcibly terminating an application program and an operating system in the personal computer section after sensing the termination request sent from the ladder circuit correspondence PC termination acknowledgement means in the numerical control system section, PC power down handling start wait means being placed in the personal computer section for waiting for the power supply voltage holding time or longer still after the power of the power unit is turned off at the beginning of PC power down handling for preventing the system from advancing to the next porcess, and and a BIOS section being placed in the personal computer section for checking that the operating system is terminated and sending a PC termination notification to the numerical control system section, wherein the power unit turns off power as a signal assigned to power off in the ladder circuit section is turned on by a signal output circuit as the power off enable signal to the ladder circuit section is turned on by the power off enable signal output means.
Thus, in the personal computer built-in numerical control system according to the invention, the power off request signal detection means in the numerical control system section detects a power off request signal from the ladder circuit, the ladder circuit correspondence PC termination acknowledgement means issues a PC termination request to the personal computer section when the power off request signal is detected by the power off request signal detection means and checks a PC termination notification from the personal computer section. When the ladder circuit correspondence PC termination acknowledgement means acknowledges the PC termination notification from the personal computer section, the power off enable signal output means being placed in the numerical control system section turns on a power off enable signal for the ladder circuit section. The PC power down handling section in the personal computer section receives the PC termination request sent from the ladder circuit correspondence PC termination acknowledgement means in the numerical control system section, it issues a request for forcibly terminating the application program and the operating system in the personal computer section. The BIOS section in the personal computer section detects the operating system being terminated in the personal computer section and issues a PC termination notification to the PC termination acknowledgement means in the numerical control system section. The power unit turns off the power as the signal assigned to power off in the ladder circuit section is turned on by the signal output circuit as the power off enable signal to the ladder circuit section is turned on by the power off enable signal output means. The PC power down handling start wait means in the personal computer section waits for the power supply voltage holding time or longer still after the power of the power unit is turned off at the beginning of PC power down handling for preventing the system from advancing to the next process.
In the personal computer built-in numerical control system according to the invention described above, when a power off switch is pressed, the ladder circuit section determines the state of any other signal input from a machine tool and if power off conditions are not satisfied, starting of power off handling is inhibited and alarm output processing is performed, and if power off conditions are satisfied, a power off request signal of the ladder circuit section is turned on.
Thus, in the personal computer built-in numerical control system according to the invention, when the power off switch is pressed, the ladder circuit section determines the state of any other signal input from the machine tool and if the power off conditions are not satisfied, starting of the power off handling is inhibited and alarm output processing is performed, and if the power off conditions are satisfied, the power off request signal of the ladder circuit section is turned on and the power off handling is started.
The personal computer built-in numerical control system according to the invention described above further includes application program start completion notification means being placed in the personal computer section for sending an application program start completion notification, and PC start completion check means being placed in the numerical control system section for checking the application program start completion notification from the application program start completion notification means, if start completion is indicated, the PC start completion check means for sending a termination processing continuation notification to the PC termination acknowledgement means.
Thus, in the personal computer built-in numerical control system according to the invention, the application program start completion notification means in the personal computer section sends a start completion notification to the numerical control system section upon completion of starting the application program, and the PC start completion check means in the numerical control system section checks the application program start completion notification from the personal computer section. If start completion is indicated, the PC start completion check means sends a termination processing continuation notification to the PC termination acknowledgement means.
The personal computer built-in numerical control system according to the invention described above further includes PC termination timeout retry check means being placed in the numerical control system section for making a retry over or timeout check at least either if PC termination notification from the personal computer section cannot be acknowledged or if application program start completion notification cannot be acknowledged, and sending a termination notification to the PC termination acknowledgement means or the ladder circuit correspondence PC termination acknowledgement means, and disk cache control means being placed in the personal computer section for invalidating a disk cache of an external storage unit in the personal computer section after sensing termination request sent from the PC termination acknowledgement means in the numerical control system section, wherein the power unit outputs a power reset signal for inhibiting a controller of the external storage unit in the personal computer section from newly writing data when the power is turned off, and. wherein the power unit has a power supply voltage holding function of holding power supply voltage for as long as the time to completion of writing if an application program, etc., starts writing onto an external storage unit at the same time as the power of the power unit is turned off.
Thus, in the personal computer built-in numerical control system according to the invention, if a response to a request sent to the personal computer section from the personal computer section cannot be acknowledged or if application program start completion notification cannot be acknowledged, the PC termination timeout retry check means in the numerical control system section makes a retry over or timeout check, and sends a termination notification to the PC termination acknowledgement means. The power unit holds the power supply voltage for as long as the time to completion of writing if the application program, etc., starts writing onto an external storage unit at the same time as the power off handling is started. After the power reset signal is input, data is prevented from being newly written onto the external storage unit.
The personal computer built-in numerical control system according to the invention described above further includes servo amplifier initialization means being placed in the numerical control system section for transmitting an emergency stop signal and a termination command to a servo amplifier when power off handling is started.
Thus, in the personal computer built-in numerical control system according to the invention, when the power off handling is started, the servo amplifier initialization means transmits an emergency stop signal and a termination command to the servo amplifier.
The personal computer built-in numerical control system according to the invention described above further includes data backup means being placed in the numerical control system section for reading a parameter registered in the numerical control system section or data, etc., edited by the user and transferring to the personal computer section as power off handling is performed, and backup data write means being placed in the personal computer section for writing the backup data from the data backup means into a determined location of a hard disk unit.
Thus, in the personal computer built-in numerical control system according to the invention, the data backup means in the numerical control system section reads the parameter registered in the numerical control system section or the data, etc., edited by the user and transfers to the personal computer section as the power off handling is performed. The backup data write means in the personal computer section writes the backup data from the data backup means into the determined location of a hard disk unit.